<?php
use app\common\middleware\AllowCrossDomain;
use app\common\middleware\AuthCheckToken;
use think\facade\Route;

// 引用前段app 使用的路由
require_once 'router_app.php';

Route::group(function () {
    Route::post('login', 'Login/login');
    Route::get('captcha', 'Login/verify');
    Route::get('loginout', 'Login/logout');
    Route::get('clear', 'Login/clear');
    Route::post('log/login', 'live.Log/addLoginErrorLog');
    Route::post('log/tc_player', 'live.Log/addTcPlayerErrorLog');
    Route::post('log/tc_player_view', 'live.Log/viewTcPlayerErrorLog');
    Route::get('live/view', 'liveManager.liveManager/view');
    Route::get('user/login', 'user.User/login');
    Route::get('user/sendVerifycode', 'user.User/sendVerifycode');
    Route::get('unification/wx_login', 'user.User/wxUnificationLogin');
    Route::post('unification/wx_login/after_execute', 'user.User/wxLoginAfterExecute');
    Route::post('user/wxlogin', 'user.User/wxlogin');
    Route::get('user/get_wx_info', 'user.User/get_wx_info');
    Route::get('user/test', 'user.User/test');
    Route::get('user/yuyue_zhibo', 'user.User/yuyue_zhibo');
    Route::get('user/check_zhibo', 'user.User/check_zhibo');
    Route::get('user/sign_zhibo', 'user.User/sign_zhibo');
    Route::get('user/check_login', 'user.User/check_login');
    Route::get('user/getAlipay', 'user.User/getAlipay');
    Route::post('user/alipay_notify', 'user.User/alipay_notify');
    Route::get('user/alipay_refund', 'user.User/alipay_refund');
    Route::get('user/check_phone_exist', 'user.User/check_phone_exist');
    Route::get('user/alipay_return_redirect', 'user.User/alipay_return_redirect');
    // Route::get('unionapp/gouwuche', 'live.UnionApp/gouwuche');
    Route::post('live/add_im', 'liveManager.liveManager/setImOpenLoginSvc');
    Route::post('live/set_order_state', 'liveManager.liveManager/setGongyuOrderState'); // 修改订单到课状态
    Route::get('alipay/getAlipay', 'user.alipay/getAlipay'); // 多商户支付宝支付
    Route::post('alipay/alipay_notify', 'user.alipay/alipay_notify'); // 多商户支付宝支付回调
    Route::get('user/alipay_refund', 'user.User/alipay_refund');
    Route::post('user/alipay_notify2', 'user.User/alipay_notify2'); //支付宝单账户支付回调
    Route::get('user/alipay_refund2', 'user.User/alipay_refund2');

    Route::any('aliCallback', 'aliyunVMS.AliCallbackController/voiceTel');

    Route::get('user/mark/CourseTag', 'user.User/GetCourseTags');

    Route::get("user/testkk", 'live.MyOrder/testafterorder');

})->middleware([AllowCrossDomain::class]);

Route::group('member', function () {
    Route::get('/info', 'system.Member/info');
    Route::post('/add', 'system.Member/add');
    Route::post('/index', 'system.Member/index');
    Route::get('/del', 'system.Member/del');
    Route::post('/edit', 'system.Member/edit');
    Route::get('/findMemberRole', 'system.Member/findMemberRole');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('zhujiao', function () {
    Route::get('/zhujiao_group_list', 'system.Zhujiao/zhujiao_group_list');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('menu', function () {
    Route::get('/router', 'system.Menu/getRouter');
    Route::get('/tree', 'system.Menu/menuTree');
    Route::post('/add', 'system.Menu/add');
    Route::post('/edit', 'system.Menu/edit');
    Route::get('/changeStatus', 'system.Menu/changeStatus');
    Route::post('/changeOrder', 'system.Menu/changeOrder');
    Route::get('/del', 'system.Menu/del');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('role', function () {
    Route::post('/index', 'system.Role/index');
    Route::post('/add', 'system.Role/add');
    Route::get('/del', 'system.Role/del');
    Route::post('/edit', 'system.Role/edit');
    Route::get('/selectRoleMenuId', 'system.Role/selectRoleMenuId');
    Route::get('/changeStatus', 'system.Menu/changeStatus');
    Route::post('/changeOrder', 'system.Menu/changeOrder');
    Route::get('/selectRole', 'system.Role/selectRole');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('datas', function () {
    Route::post('/index', 'data.Datas/index');
    Route::post('/queryPhone', 'data.Datas/queryPhone'); // 手机验证码查询
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('generate', function () {
    Route::get('/selectTable', 'generate.Generate/selectTable');
    Route::post('/selectCloums', 'generate.Generate/selectCloums');

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('dept', function () {

    Route::get('/tree', 'system.Dept/deptTree');
    Route::post('/add', 'system.Dept/add');
    Route::post('/edit', 'system.Dept/edit');
    Route::post('/changeOrder', 'system.Dept/changeOrder');
    Route::get('/del', 'system.Dept/del');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('files', function () {
    Route::post('/addset', 'files.Fileset/add');
    Route::get('/indexset', 'files.Fileset/index');
    Route::post('/index', 'files.Files/index');
    Route::get('/del', 'files.Files/del');
    Route::post('/batchRemove', 'files.Files/batchRemove');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::rule('Uploads/index', 'Upload/uploads')
    ->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('generate', function () {
    Route::post('/getData', 'generate.Generate/getData');
    Route::post('/genEdit', 'generate.Generate/index');
    Route::post('/add', 'generate.Generate/add');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

// Route::get('/typedata','live.Shuziren/typedata');

Route::group('shuziren', function () {
    Route::get('/typedata', 'live.Shuziren/typedata');
    Route::post('/getdata', 'live.Shuziren/getdata');
    Route::post('/createShuziren', 'live.Shuziren/createShuziren');
    Route::post('/delShuziren', 'live.Shuziren/delShuziren');
    Route::post('/editShuziren', 'live.Shuziren/editShuziren');
    Route::post('/pldelShuziren', 'live.Shuziren/pldelShuziren');
    Route::post('/daorushuziren', 'live.Shuziren/daorushuziren');
//数字人类型
    Route::post('/getdatagroup', 'live.Shuziren/getdatagroup');
    Route::post('/createShuzirengroup', 'live.Shuziren/createShuzirengroup');
    Route::post('/delShuzirengroup', 'live.Shuziren/delShuzirengroup');
    Route::post('/editShuzirengroup', 'live.Shuziren/editShuzirengroup');
    Route::post('/pldelShuzirengroup', 'live.Shuziren/pldelShuzirengroup');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('yanjincigroup', function () {
    Route::post('/getdatagroup', 'live.Yanjincigroup/getdatagroup');
    Route::post('/createYanjincigroup', 'live.Yanjincigroup/createYanjincigroup');
    Route::post('/delYanjincigroup', 'live.Yanjincigroup/delYanjincigroup');
    Route::post('/editYanjincigroup', 'live.Yanjincigroup/editYanjincigroup');
    Route::post('/pldelYanjincigroup', 'live.Yanjincigroup/pldelYanjincigroup');

    Route::post('/getdata', 'live.Yanjincigroup/getdata');
    Route::post('/createYanjinci', 'live.Yanjincigroup/createYanjinci');
    Route::post('/delYanjinci', 'live.Yanjincigroup/delYanjinci');
    Route::post('/editYanjinci', 'live.Yanjincigroup/editYanjinci');
    Route::post('/pldelYanjinci', 'live.Yanjincigroup/pldelYanjinci');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('manager/live', function () {

    Route::post('/list', 'liveManager.liveManager/list');
    Route::post('/add', 'liveManager.liveManager/add');
    Route::post('/view', 'liveManager.liveManager/view');
    Route::post('/update', 'liveManager.liveManager/update');
    Route::post('/del', 'liveManager.liveManager/del');
    Route::post('/end', 'liveManager.liveManager/end');
    // 直播数据列表
    Route::get('/stat', 'liveManager.liveManager/liveStat');
    Route::get('/liveSellerStat', 'liveManager.liveManager/liveSellerStat');
    Route::post('/orderInfo', 'liveManager.liveManager/orderInfo');
    Route::post('/day2NotDaoke', 'liveManager.liveManager/day2NotDaoke');

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('live', function () {
    Route::get('/typedata', 'live.Shuziren/typedata');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('comm/dict', function () {
    Route::post('/:name', 'data.dict/getDict');
})->middleware([AllowCrossDomain::class]);

Route::group('order', function () {
    Route::post('/getOrderData', 'live.Order/getOrderData');
    Route::post('/tuikuan', 'live.Order/tuikuan');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('deposit', function () {
    Route::post('/list', 'live.Deposit/list');
    Route::post('/edit', 'live.Deposit/edit');
    Route::post('/tuikuan', 'live.Deposit/tuikuan');
    Route::post('/info', 'live.Deposit/info');
    Route::get('/siyuCourseList', 'live.Deposit/siyuCourseList');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('selled_order', function () {
    Route::post('/getOrderData', 'live.SelledOrder/getOrderData');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('liveinfo/', function () {
    Route::get('/status', 'liveManager.liveManager/getStatus');
    Route::post('/sign', 'liveManager.TIm/makeUserSign');
    Route::post('/sendCommand', 'liveManager.TIm/SendChartCommand');
    // changeLiveStatus
    Route::post('/cmd', 'liveManager.liveManager/changeLiveStatus');

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('live/manager/', function () {
    Route::post('/info', 'liveManager.liveManager/liveInfoWithOutUserInfo');
    Route::post('/getSalerList', 'liveManager.liveOnline/getSalerList');
    Route::post('/getLineUser', 'liveManager.liveOnline/getLineUser');
    Route::post('/getPinglunList', 'liveManager.liveOnline/getPinglunList');
    Route::post('/getSalerInvatationUserIds', 'liveManager.liveOnline/getSalerInvatationUserIds');
    // changeLiveStatus
    Route::post('/isUserSaler', 'liveManager.liveOnline/isUserSaler');
    Route::post('/sendCourseSellCommand', 'liveManager.liveOnline/sendCourseSellCommand'); //sendCommand
    Route::post('/sendCourseSellCmd', 'liveManager.liveOnline/sendCourseSellCmd');
    Route::post('/getSellOutGoodsIdList', 'liveManager.liveOnline/getSellOutGoodsIdList');
    Route::post('/getPlayInfo', 'liveManager.liveOnline/getPlayInfo');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('user', function () {
    Route::post('/getdata', 'user.User/getdata');
    Route::post('/getUserInfo', 'user.User/getUserInfo');
    Route::post('/getOrder', 'user.User/get_order');
    Route::post('/set_user__wx_online_offline_tag', 'user.User/set_user__wx_online_offline_tag');
    Route::post('/clean_all_wxwork_online_tag', 'user.User/clean_all_wxwork_tag');

})->middleware([AllowCrossDomain::class]);

Route::group('commentGroup', function () {
    Route::post('/getCommentGroup', 'live.CommentGroup/getCommentGroup');
    Route::post('/createCommentGroup', 'live.CommentGroup/createCommentGroup');
    Route::post('/delCommentGroup', 'live.CommentGroup/delCommentGroup');
    Route::post('/editCommentGroup', 'live.CommentGroup/editCommentGroup');
    Route::post('/pldelCommentGroup', 'live.CommentGroup/pldelCommentGroup');

    Route::post('/getdata', 'live.CommentGroup/getdata');
    Route::post('/createPingluninfo', 'live.CommentGroup/createPingluninfo');
    Route::post('/delPingluninfo', 'live.CommentGroup/delPingluninfo');
    Route::post('/editPingluninfo', 'live.CommentGroup/editPingluninfo');
    Route::post('/pldelPingluninfo', 'live.CommentGroup/pldelPingluninfo');

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('unionapp', function () {
    Route::get('/gouwuche', 'live.UnionApp/gouwuche');
    Route::post('/createOrder', 'live.UnionApp/createOrder');
    Route::post('/getGoodsInfo', 'live.UnionApp/getGoodsInfo');
    Route::post('/getShangpinInfo', 'live.UnionApp/getShangpinInfo');
    Route::post('/getTanKaInfo', 'live.UnionApp/getTanKaInfo');
    Route::post('/notify', 'live.UnionApp/notify');
    Route::post('/tuikuan_notify', 'live.UnionApp/tuikuan_notify');
    Route::post('/createPrepayId', 'live.UnionApp/createPrepayId');

    Route::post('/entertime', 'live.UnionApp/entertime');
    Route::post('/exittime', 'live.UnionApp/exittime');

    Route::get('/chengjiaodata', 'live.UnionApp/chengjiaodata');

    Route::post('/getPlayInfo', 'live.SiyuApp/getPlayInfo');
    Route::post('/getUpdatePrice', 'live.UnionApp/getUpdatePrice');
    Route::post('/getDepositInfo', 'live.UnionApp/getDepositInfo');
    Route::post('/syncUserDeposit', 'live.UnionApp/syncUserDeposit');

})->middleware([AllowCrossDomain::class]);

Route::group('unionappfuwushang', function () {
    Route::post('/notify', 'live.UnionAppFuWuShang/notify');
    Route::post('/tuikuan_notify', 'live.UnionAppFuWuShang/tuikuan_notify');
})->middleware([AllowCrossDomain::class]);

Route::group('callback/', function () {
    Route::post('/live', 'liveManager.liveManager/liveCallBack');
    Route::post('/im', 'liveManager.TIm/ImCallBack');

})->middleware([AllowCrossDomain::class]);

Route::group('myorder', function () {
    Route::get('/getMyOrderData', 'live.MyOrder/getMyOrderData');
    Route::get('/getDepositData', 'live.MyOrder/getDepositData');
    Route::get('/getMyOrderInfo', 'live.MyOrder/getMyOrderInfo');
    Route::post('/payOrder', 'live.MyOrder/payOrder');
    Route::post('/createPayOrder', 'live.MyOrder/createPayOrder');
    Route::post('/cancelOrder', 'live.MyOrder/cancelOrder');
    Route::post('/test', 'live.MyOrder/test');
})->middleware([AllowCrossDomain::class]);

Route::group('screen', function () {

    Route::post('/shujukanban', 'live.Screen/shujukanban');
    Route::post('/illegal', 'live.Screen/illegal');
    Route::post('/realStatistics', 'live.Screen/realStatistics');

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('action', function () {

    Route::post('/getYaoqingZhujiao2', 'live.Action/getYaoqingZhujiao2');
    Route::post('/getZhuJiaoInfo', 'live.Action/getZhuJiaoInfo');
    Route::post('/getUserInfo', 'live.Action/getUserInfo');
    Route::post('/getUserInfoDc', 'live.Action/getUserInfoDc');
    Route::post('/delUserInfo', 'live.Action/delUserInfo');
    Route::post('/pldelUserInfo', 'live.Action/pldelUserInfo');
    Route::post('/getuser', 'live.Action/getuser');

    Route::post('/getyaoqing', 'live.Action/getyaoqing');
    Route::post('/getyaoqingzonglan', 'live.Action/getyaoqingzonglan');
    Route::post('/pldelyaoqing', 'live.Action/pldelyaoqing');
    Route::post('/delyaoqing', 'live.Action/delyaoqing');

    Route::post('/getpinglun', 'live.Action/getpinglun');
    Route::post('/pldelpinglun', 'live.Action/pldelpinglun');
    Route::post('/delpinglun', 'live.Action/delpinglun');
    Route::post('/addpinglun', 'live.Action/addpinglun');
    Route::post('/editpinglun', 'live.Action/editpinglun');

    Route::post('/getguankong', 'live.Action/getguankong');
    Route::post('/pldelguankong', 'live.Action/pldelguankong');
    Route::post('/delguankong', 'live.Action/delguankong');

    Route::post('/getyaoyue', 'live.Action/getyaoyue');

    Route::post('/getyingxiao', 'live.Action/getyingxiao');
    Route::post('/pldelyingxiao', 'live.Action/pldelyingxiao');
    Route::post('/delyingxiao', 'live.Action/delyingxiao');

    Route::post('/getShijian', 'live.Action/getShijian');

    Route::post('/getjilu', 'live.Action/getjilu');

    Route::post('/getpayorder', 'live.Action/getpayorder');

    Route::post('/getPingLunUser', 'live.Action/getPingLunUser');
    Route::post('/getChouJiang', 'live.Action/getChouJiang');
    Route::post('/getChouJiangUser', 'live.Action/getChouJiangUser');
    Route::post('/getChouJiangRobot', 'live.Action/getChouJiangRobot');
    Route::post('/getAllChouJiangRobot', 'live.Action/getAllChouJiangRobot');
    Route::post('/getEditChouJiangRobot', 'live.Action/getEditChouJiangRobot');
    Route::post('/getAllChouJiangUser', 'live.Action/getAllChouJiangUser');
    Route::post('/getEditChouJiangUser', 'live.Action/getEditChouJiangUser');
    Route::post('/getfinish', 'live.Action/getfinish');
    Route::post('/getPrizeList', 'live.Action/getPrizeList');

    Route::post('/getNoticeList', 'live.Action/getNoticeList');
    Route::post('/getBlackbordList', 'live.Action/getBlackbordList');

    Route::post('/daokekanban', 'live.Action/daokekanban'); // 到课看板
    Route::post('/yaoyueDaokeUser', 'live.Action/yaoyueDaokeUser'); // 邀约到课用户

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);
Route::group('doudian', function () {
    Route::post('doudian/order_list', 'doudian.Doudian/order_list');
    Route::post('doudian/order_detail', 'doudian.Doudian/order_detail');
    Route::post('doudian/order_detail_json', 'doudian.Doudian/order_detail_json');
    Route::post('doudian/sms_template_apply', 'doudian.Sms/sms_template_apply');
    Route::post('doudian/sms_template_list', 'doudian.Sms/sms_template_list');
    Route::post('doudian/sms_sign_apply', 'doudian.Sms/sms_sign_apply');
    Route::post('doudian/sms_sign_apply_list', 'doudian.Sms/sms_sign_apply_list');
    Route::post('doudian/sms_send', 'doudian.Sms/sms_send');
    Route::post('doudian/sms_sign_del', 'doudian.Sms/sms_sign_del');
    Route::post('doudian/sms_template_del', 'doudian.Sms/sms_template_del');
    Route::post('doudian/sms_sign_revoke', 'doudian.Sms/sms_sign_revoke');
    Route::post('doudian/sms_sign_list', 'doudian.Sms/sms_sign_list');
    Route::post('doudian/addV2', 'doudian.Doudian/addV2');
    Route::post('doudian/getShopCategory', 'doudian.Doudian/getShopCategory');
    Route::post('doudian/coupons_verify', 'doudian.Doudian/coupons_verify');
    Route::post('doudian/coupons_cancelVerify', 'doudian.Doudian/coupons_cancelVerify');
    Route::post('doudian/coupons_abandon', 'doudian.Doudian/coupons_abandon');
    Route::post('doudian/notify', 'doudian.Doudian/notify');
    Route::post('doudian/syncV2', 'doudian.Doudian/syncV2');
    Route::post('doudian/couponsList', 'doudian.Doudian/couponsList');
    Route::post('doudian/test', 'doudian.Doudian/test');
    Route::post('doudian/after_sale_list', 'doudian.Doudian/after_sale_list');
    Route::post('doudian/refund', 'doudian.Doudian/refund');
    Route::post('doudian/brandList', 'doudian.Doudian/brandList');
    Route::get('doudian/handsync', 'doudian.Doudian/handsync');
    Route::get('doudian/handrefund', 'doudian.Doudian/handrefund');
    Route::post('doudian/sms_notify', 'doudian.Doudian/sms_notify');
    Route::post('doudian/mysend', 'doudian.Doudian/mysend');
})->middleware([AllowCrossDomain::class]);

Route::group('behavior', function () {
    Route::post('/invitation/list', 'behavior.Invitation/list');
    Route::post('/invitation/del', 'behavior.Invitation/del');
})->middleware([AllowCrossDomain::class]);

Route::group('invitation', function () {

    Route::post('/getuserinfo', 'live.Invitation/getUserInfo');
    Route::post('/savepublish', 'live.Invitation/savepublish');
    Route::post('/querybiaoqian', 'live.Invitation/querybiaoqian');
    Route::post('/querytagUser', 'live.Invitation/querytagUser');
    Route::post('/queryUser', 'live.Invitation/queryUser');
    Route::post('/querytagUser_no', 'live.Invitation/querytagUser_no'); //oliver
    Route::post('/querycontent', 'live.Invitation/querycontent');
    Route::post('/ordertime_queryUser', 'live.Invitation/ordertime_queryUser');
    Route::post('/getStatusList', 'live.Invitation/getStatusList');
    Route::post('/deletePlan', 'live.Invitation/deletePlan');
    Route::post('/getOrderList', 'live.Invitation/getOrderList');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('course', function () {

    Route::post('/getCourseData', 'live.Course/getCourseData');
    Route::post('/updateCourseFee', 'live.Course/updateCourseFee');

})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('prize', function () {

    Route::get('/prize/list', 'choujiang.Prize/list');
    Route::post('/prize/add', 'choujiang.Prize/add');
    Route::post('/prize/editPrize', 'choujiang.Prize/editPrize');
    Route::post('/prize/delPrize', 'choujiang.Prize/delPrize');
    Route::post('/prize/finishPrize', 'choujiang.Prize/finishPrize');
    Route::post('/prize/addLottery', 'choujiang.Prize/addLottery');
    Route::post('/prize/getfinish', 'choujiang.Prize/getfinish');
    Route::post('/prize/sendPrize', 'choujiang.Prize/sendPrize');
})->middleware([AllowCrossDomain::class, AuthCheckToken::class]);

Route::group('lottery', function () {
    Route::post('/sendLotter', 'choujiang.Lottery/sendLotter');
    Route::post('/getUserList', 'choujiang.Lottery/getUserList');
    Route::post('/getUserLotteryList', 'choujiang.Lottery/getUserLotteryList');
    Route::post('/getWinners', 'choujiang.Lottery/getWinners');
    Route::post('/getLingjiang', 'choujiang.Lottery/getLingjiang');

})->middleware([AllowCrossDomain::class]);
